<?php

/**
 * BolaoTournament form base class.
 *
 * @method BolaoTournament getObject() Returns the current form's model object
 *
 * @package    bolao-aabb
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseBolaoTournamentForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'             => new sfWidgetFormInputHidden(),
      'creator_id'     => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUserProfile', 'add_empty' => false)),
      'subcategory_id' => new sfWidgetFormPropelChoice(array('model' => 'BolaoSubcategory', 'add_empty' => false)),
      'name'           => new sfWidgetFormInputText(),
      'start_date'     => new sfWidgetFormDate(),
      'scoresheet'     => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'             => new sfValidatorPropelChoice(array('model' => 'BolaoTournament', 'column' => 'id', 'required' => false)),
      'creator_id'     => new sfValidatorPropelChoice(array('model' => 'sfGuardUserProfile', 'column' => 'id')),
      'subcategory_id' => new sfValidatorPropelChoice(array('model' => 'BolaoSubcategory', 'column' => 'id')),
      'name'           => new sfValidatorString(array('max_length' => 50)),
      'start_date'     => new sfValidatorDate(),
      'scoresheet'     => new sfValidatorString(array('max_length' => 255, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('bolao_tournament[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'BolaoTournament';
  }


}
